﻿using System;
using System.IO;

namespace ConsoleApp13
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo directoryInfo = new DirectoryInfo("D:");
            directoryInfo.Create();
            string path = "D:\\";

            FileStream fs = File.Create(path);

            Console.WriteLine("文件创建时间:" + File.GetCreationTime(path));
            Console.WriteLine("文件最后写入时间：" + File.GetLastWriteTime(path));

            fs.Close();
            StreamWriter streamWriter = new StreamWriter(path);
            streamWriter.WriteLine("满怀希望才能所向披靡");

            streamWriter.Flush();
            streamWriter.Close();
        }
    }
}
